package cn.snsprj.authclient.controller;

import cn.snsprj.authclient.common.SessionManage;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author SKH
 * @date 2018-08-22 19:11
 **/
@RestController
@RequestMapping("/test")
public class TestController {

    @RequestMapping(value = "/map",method = {RequestMethod.GET})
    public String testMap(@RequestParam(value = "value",required = false) String value){

        if (StringUtils.isNotBlank(value)){
            SessionManage.TEST_MAP.put("userId", value);
        }

        String userId = (String) SessionManage.TEST_MAP.get("userId");

        return userId;
    }
}
